<script type="text/javascript">
//app分享
(function(){

var page_title = document.title;
var page_current_url = window.location.href;
var page_img = document.getElementsByTagName('img')[0].src;
var page_desc = page_title;

var dataForWeixin={
   appId:"",
   MsgImg:page_img,
   TLImg:page_img,
   url:page_current_url,
   title:page_title,
   desc:page_desc,
   fakeid:"",
   callback:function(){}
};   
   var onBridgeReady=function(){
   WeixinJSBridge.on('menu:share:appmessage', function(argv){
      WeixinJSBridge.invoke('sendAppMessage',{
         "appid":dataForWeixin.appId,
         "img_url":dataForWeixin.MsgImg,
         "img_width":"120",
         "img_height":"120",
         "link":dataForWeixin.url,
         "desc":dataForWeixin.desc,
         "title":dataForWeixin.title
      }, function(res){(dataForWeixin.callback)();});
   });
   WeixinJSBridge.on('menu:share:timeline', function(argv){
	  (dataForWeixin.callback)();
	  WeixinJSBridge.invoke('shareTimeline',{
         "img_url":dataForWeixin.TLImg,
         "img_width":"120",
         "img_height":"120",
         "link":dataForWeixin.url,
         "desc":dataForWeixin.desc,
         "title":dataForWeixin.title
      }, function(res){});
   });
   WeixinJSBridge.on('menu:share:weibo', function(argv){
	  WeixinJSBridge.invoke('shareWeibo',{
         "content":dataForWeixin.title,
         "url":dataForWeixin.url
      }, function(res){(dataForWeixin.callback)();});
   });
   WeixinJSBridge.on('menu:share:facebook', function(argv){
	  (dataForWeixin.callback)();
	  WeixinJSBridge.invoke('shareFB',{
         "img_url":dataForWeixin.TLImg,
         "img_width":"120",
         "img_height":"120",
         "link":dataForWeixin.url,
         "desc":dataForWeixin.desc,
         "title":dataForWeixin.title
      }, function(res){});
   });
};
if(document.addEventListener){
   document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
}else if(document.attachEvent){
   document.attachEvent('WeixinJSBridgeReady'   , onBridgeReady);
   document.attachEvent('onWeixinJSBridgeReady' , onBridgeReady);
}
})();


</script>



<script type="text/javascript">
    
    Do('c.header');

    Do.ready( function(){
    
        

        $('._tiyan').click(function(){
          Do('userload',function(){
            if(window.USERDATA && window.USERDATA.isLogin){
              window.location.href='/type/product.php';
            } else {
              window.location.href='/register/?source=61933';
              //LOGREG.register({source:61933});
            }
          });
        });
        ( function(){
            var contents = $( "#speekContents").html().split( "-----");
            var code = '<li>\
                          <div class="avatar z blk5"><a href="javascript:;" class="icon-common"><img src="{0}" class="blk5"></a></div>\
                          <a href="javascript:;"><p class="xs3 tar"> <b>{1}</b>@{2}</p>\
                          <p class="xs2">{3}</p></a>\
                        </li>';
            var $container = $( ".speekContainer"),
                $arrow = $('.scroll .Dbtn').children();

            function rp( arr, code){
                $.each( arr, function( index, value){
                    code = code.replace( new RegExp( "\\{" + index + "\\}", "gi"), value);
                });
                return code;
            }

            for( var i = 0, len = contents.length; i < len; i += 2){
                var cnts = contents[ i].split( "|");
                var $div = $( "<div class='item'></div>").appendTo( $container);
                $div = $( "<ul class='xl'></ul>").appendTo( $div);

                $div.append( rp( cnts, code + ''));

                if( contents[ i + 1]){
                    cnts = contents[ i + 1].split( "|");
                    $div.append( rp( cnts, code + ''));
                }
            }
            $container.children().each(function(index){
               $(this).attr('data-ind',index);
            });
            new Movement({
                marg: $("#speek"),
                onMarquee: function( obj){
                    obj.easing.hor_animate( $container, obj.dir, function() {
                        obj.finishFn();
                        var ind = $container.children( ":first").data( "ind");
                        $arrow.removeClass( "on");
                        $arrow.eq( ind).addClass( "on");
                    });
                },
                //leftArrow: $( ".speek_prev"),
                //rightArrow: $( ".speek_next"),
                cirBtn : $arrow,
                timeout: 3000
            });
        })();
    });
</script>


<script type="text/javascript">

function is_weixn(){  
    var ua = navigator.userAgent.toLowerCase();  
    if(ua.match(/MicroMessenger/i)=="micromessenger") {  
        return true;  
    } else {  
        return false;  
    }  
}  

if(is_weixn()){
    var navtips = document.createElement('div');
    navtips.className = "navtips";
    document.body.appendChild(navtips);
}

function isMobileBrowser() {
    var u = navigator.userAgent,
    app = navigator.appVersion;
    if (u.indexOf('Android') > -1 || u.indexOf('iPhone') > -1) {
        return true;
    } else {
        return false;
    }
}
</script>